#ifndef YASDOWNLOADCOORDINATOR_H_
#define YASDOWNLOADCOORDINATOR_H_

#include <vector>
#include <map>
#include <utility>

#include <pthread.h>

#include "YasDownloadAgent.h"

namespace yas{

class YasDownloadCoordinator: public YasCommon
{
public:
	YasDownloadCoordinator();
	virtual ~YasDownloadCoordinator();
	int addAgent(YasDownloadAgent *agent);
	void startAllAgents();
private:
	std::vector<YasDownloadAgent*> agents;
	std::vector<pthread_t> threads;
	std::map<YasDownloadAgent*, pthread_t*> agent_thread;
	pthread_t& addNewThread();
};

};

#endif
